package org.example.book.normal.observe;

import org.example.book.normal.state.order.DeprecatedConstants;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Observer;

@Component
public class DeprecatedReceiveObserver extends DeprecatedAbstractObserver {

    @PostConstruct
    public void init() {
        DeprecatedConstants.OBSERVERS.add(this);
    }
    @Override
    public void orderStateHandle(String orderId, String orderState) {
        if (!"ORDER_FINISH".equals(orderState)) {
            return;
        }
        System.out.println("监听到：订单收货成功，通过命令模式进行后续处理");
    }
}
